-- @Author: richardzgt﻿​
-- @Date:   2018-09-26 18:14:44
-- @Last Modified by:   richardzgt﻿​
-- @Last Modified time: 2018-09-30 16:31:38


function write_header()
    -- body
    local cjson = require("cjson")
    local h1 = ngx.req.get_headers()
    local REQ_H,err = cjson.encode(h1)
    ngx.var.req_header = REQ_H

    local h2 = ngx.resp.get_headers()
    local RESP_H,err = cjson.encode(h2)
    ngx.var.resp_header = RESP_H
end



write_header()